Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ALB listener rule update regression #11364

Merged
merged 2 commits into from
Dec 19, 2019
Merged

Conversation

dpiddockcmp
Copy link
Contributor

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #11323
Closes #11362

Release note for CHANGELOG:

resource/aws_lb_listener_rule: fixes regression when updating a rule without modifying condition

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSLBListenerRule'
--- PASS: TestAccAWSLBListenerRule_multipleConditionThrowsError (3.89s)
--- PASS: TestAccAWSLBListenerRule_conditionAttributesCount (52.92s)
--- PASS: TestAccAWSLBListenerRule_basic (252.07s)
--- PASS: TestAccAWSLBListenerRule_Action_Order_Recreates (253.87s)
--- PASS: TestAccAWSLBListenerRule_conditionHostHeader (272.30s)
--- PASS: TestAccAWSLBListenerRule_Action_Order (395.72s)
--- PASS: TestAccAWSLBListenerRule_cognito (243.62s)
--- PASS: TestAccAWSLBListenerRule_oidc (294.04s)
--- PASS: TestAccAWSLBListenerRule_conditionHttpRequestMethod (295.31s)
--- PASS: TestAccAWSLBListenerRule_conditionHttpHeader_invalid (3.26s)
--- PASS: TestAccAWSLBListenerRule_priority (575.85s)
--- PASS: TestAccAWSLBListenerRule_conditionUpdatePathPattern_deprecated (388.26s)
--- PASS: TestAccAWSLBListenerRule_conditionPathPattern_deprecated (445.48s)
--- PASS: TestAccAWSLBListenerRule_conditionUpdateMultiple (314.38s)
--- PASS: TestAccAWSLBListenerRule_conditionMultiple (262.48s)
--- PASS: TestAccAWSLBListenerRule_conditionHttpHeader (413.04s)
--- PASS: TestAccAWSLBListenerRule_conditionUpdateMixed (357.01s)
--- PASS: TestAccAWSLBListenerRule_conditionSourceIp (261.76s)
--- PASS: TestAccAWSLBListenerRule_conditionQueryString (265.65s)
--- PASS: TestAccAWSLBListenerRule_conditionPathPattern (251.04s)
--- PASS: TestAccAWSLBListenerRule_redirect (263.37s)
--- PASS: TestAccAWSLBListenerRule_fixedResponse (308.00s)
--- PASS: TestAccAWSLBListenerRule_conditionHostHeader_deprecated (242.03s)
--- PASS: TestAccAWSLBListenerRule_updateFixedResponse (318.64s)
--- PASS: TestAccAWSLBListenerRule_changeListenerRuleArnForcesNew (366.77s)
--- PASS: TestAccAWSLBListenerRule_updateRulePriority (311.55s)
--- PASS: TestAccAWSLBListenerRuleBackwardsCompatibility (250.93s)

New condition rule logic breaks when one a condition is present but
*not* being updated. Includes single condition when the action is being
modified. User is presented with:
Error: Only one of field, host_header, http_header,
http_request_method, path_pattern, query_string or source_ip can be set
in a condition block
@dpiddockcmp dpiddockcmp requested a review from a team December 19, 2019 14:10
@ghost ghost added size/XL Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. service/elbv2 Issues and PRs that pertain to the elbv2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Dec 19, 2019
@bflad bflad added bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. and removed needs-triage Waiting for first response or review from a maintainer. labels Dec 19, 2019
Copy link
Contributor

@gdavison gdavison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

One fix to a comment.

values := conditionMap["values"].([]interface{})
if len(values) == 0 {
return nil, errors.New("Both field and values must be set in a condition block")
// This code is also hit during an update when the condition has not been modified. Issues: GH-11232 and GH-11362
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: the first issue GH-11323

@bflad bflad added this to the v2.43.0 milestone Dec 19, 2019
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Output from acceptance testing:

--- PASS: TestAccAWSLBListenerRule_conditionHttpHeader_invalid (3.89s)
--- PASS: TestAccAWSLBListenerRule_multipleConditionThrowsError (4.41s)
--- PASS: TestAccAWSLBListenerRule_conditionAttributesCount (28.37s)
--- PASS: TestAccAWSLBListenerRule_fixedResponse (175.92s)
--- PASS: TestAccAWSLBListenerRule_basic (180.33s)
--- PASS: TestAccAWSLBListenerRule_conditionHttpHeader (180.49s)
--- PASS: TestAccAWSLBListenerRule_conditionHttpRequestMethod (185.53s)
--- PASS: TestAccAWSLBListenerRule_conditionHostHeader (187.50s)
--- PASS: TestAccAWSLBListenerRule_cognito (190.30s)
--- PASS: TestAccAWSLBListenerRule_updateRulePriority (196.64s)
--- PASS: TestAccAWSLBListenerRule_conditionPathPattern_deprecated (202.36s)
--- PASS: TestAccAWSLBListenerRule_conditionPathPattern (209.18s)
--- PASS: TestAccAWSLBListenerRule_Action_Order (210.40s)
--- PASS: TestAccAWSLBListenerRule_conditionHostHeader_deprecated (215.83s)
--- PASS: TestAccAWSLBListenerRule_updateFixedResponse (221.31s)
--- PASS: TestAccAWSLBListenerRule_redirect (225.96s)
--- PASS: TestAccAWSLBListenerRule_oidc (226.93s)
--- PASS: TestAccAWSLBListenerRule_conditionQueryString (208.73s)
--- PASS: TestAccAWSLBListenerRule_conditionUpdatePathPattern_deprecated (240.20s)
--- PASS: TestAccAWSLBListenerRule_changeListenerRuleArnForcesNew (253.40s)
--- PASS: TestAccAWSLBListenerRuleBackwardsCompatibility (260.08s)
--- PASS: TestAccAWSLBListenerRule_Action_Order_Recreates (261.67s)
--- PASS: TestAccAWSLBListenerRule_priority (280.50s)
--- PASS: TestAccAWSLBListenerRule_conditionUpdateMultiple (177.25s)
--- PASS: TestAccAWSLBListenerRule_conditionMultiple (190.69s)
--- PASS: TestAccAWSLBListenerRule_conditionUpdateMixed (198.27s)
--- PASS: TestAccAWSLBListenerRule_conditionSourceIp (208.93s)

@bflad bflad merged commit 5dc0549 into hashicorp:master Dec 19, 2019
bflad added a commit that referenced this pull request Dec 19, 2019
@ghost
Copy link

ghost commented Dec 19, 2019

This has been released in version 2.43.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@dpiddockcmp dpiddockcmp deleted the fix/11323 branch December 20, 2019 09:09
@ghost
Copy link

ghost commented Mar 28, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/elbv2 Issues and PRs that pertain to the elbv2 service. size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
4 participants